<?php get_header(); the_post(); ?>
						
				
				<div class="content content-interna">
					<div class="header-post">
						<span class="bread-crumb">
							<?php if(function_exists('bcn_display')) : bcn_display(); endif; ?>
						</span>
						<span class="clear"></span>
						<div class="titulo">
							<?php the_category(); ?>
							<?php if (taxonomy_exists('categoria_de_atuacoes')) : the_terms(get_the_ID(), 'categoria_de_atuacoes'); endif; ?>
							<?php if (taxonomy_exists('categoria_de_artigos')) : the_terms(get_the_ID(), 'categoria_de_artigos'); endif; ?>
						</div>
						<span class="clear"></span>
					</div><!-- /header-post -->
					<span class="clear"></span>
					<div class="post">
						<span class="data-post"><?php the_time('d.m.Y'); ?></span>
						<div class="tit-post <? if (!has_post_thumbnail()) : echo ' no-image'; endif; ?>"><?php the_title(); ?></div>
						<span class="clear"></span>
						<div class="content-post">
							<?php
								if (has_post_thumbnail()) :
									
									$id_thumbnail = get_post_thumbnail_id(get_the_ID());
									if (substr($id_thumbnail,0,3) != 'ngg') : //se não for nextgen
										$image_src = wp_get_attachment_image_src($id_thumbnail, 'medium');
										if (is_array($image_src)) :
											$image_src = $image_src[0];
										endif;

										$link = wp_get_attachment_image_src($id_thumbnail, 'full');
										if (is_array($link)) :
											$link = $link[0];
										endif;
										
									else :
										$id_ngg = str_replace('ngg-', '', $id_thumbnail);
										$picture = nggdb::find_image($id_ngg);
										
										$image_src = $picture->imageURL;
										$link = $picture->imageURL;
									endif;

									$galeria = get('galeria_relacionada');
									if ($galeria > 0) : //se tiver galeria relacionada
										$link = get_permalink($galeria);
									 	$class = '';
									 	$class_img = 'img-destacada-post';
										$galeria = '<span class="veja">Veja a galeria completa</span>';
										$title = 'Veja a galeria completa';
									 	$lupa = '';
									else : //se não tiver galeria
									 	$class = 'colorbox-post';
									 	$class_img = '';
										$galeria = '';
									 	$title = get_the_title();
									 	$lupa = '<img class="lupa-fotos" src="'. get_bloginfo('template_directory'). '/img/lupa-fotos.png"/>';
									endif;

							?>
									<div class="wrapper-img-destacada">
										<a class="<?php echo $class; ?>" title="<?php echo get('legenda_foto'); ?>" href="<?php echo $link; ?>">
											<img class="<?php echo $class_img; ?>" title="<?php echo $title; ?>" style="max-width: 390px;" src="<?php echo $image_src; ?>" />										
											<?php echo $lupa . $galeria; ?>
										</a>
									</div>
						<?php
							endif; //has_post_thumbnail()
						?>
							<div class="post"><?php the_content(); ?></div>
						</div><!-- /content-post -->
						<span class="clear"></span>
					</div><!-- /Post -->
					<span class="clear"></span>
					<div class="footer-post">
					</div>
				</div><!-- /Content Interna -->

			<?php get_footer(); ?>
